package com.maxatime.service.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.maxatime.pojo.entity.SysMenu;
import com.maxatime.dao.SysMenuMapper;
import com.maxatime.pojo.entity.SysRole;
import com.maxatime.service.ISysMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 菜单权限表 服务实现类
 * </p>
 *
 * @author Ssb
 * @since 2024-07-15
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {

    @Autowired
    SysMenuMapper sysMenuMapper;
    @Override
    public Map<String, Object> map(SysMenu sysMenu) {
        PageHelper.startPage(sysMenu.getPageNum(),sysMenu.getPageSize());
        List<SysMenu> list = sysMenuMapper.list(sysMenu);
        PageInfo<SysMenu> pageinfo = new PageInfo<SysMenu>(list);
        Map<String, Object> m = new HashMap<>();
        m.put("list", list);
        m.put("pageInfo", pageinfo);
        return m;
    }
}
